package com.yueka.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yueka.pojo.entity.studentFollowRecord.StudentFollowRecord;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentFollowRecordMapper extends BaseMapper<StudentFollowRecord> {
    @Select("SELECT sfr.id as id, now_status, content, system_user_id, system_user_name, student_id, images, sfr.create_time as create_time, sfr.update_time as update_time FROM student_follow_record sfr, system_user su WHERE sfr.system_user_id = su.id and sfr.student_id = #{studentId} order by sfr.create_time desc")
    List<StudentFollowRecord> list(Integer studentId);

    @Update("UPDATE student_follow_record SET now_status = #{nowStatus}, content = #{content}, system_user_id = #{systemUserId}, images = #{images}, update_time = #{updateTime} WHERE id = #{id}")
    void update(StudentFollowRecord studentFollowRecord);
}
